home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / DEF_SHEL.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  63 lines

  1. #ifndef NO_MEMORY_H
  2. #include <memory.h>
  3. #endif
  4. #define        CURSES_LIBRARY  1
  5. #include <curses.h>
  6. #undef def_shell_mode
  7.  
  8. #ifndef        NDEBUG
  9. char *rcsid_def_shel = "$Header: c:/curses/portable/RCS/def_shel.c%v 2.0 1992/11/15 03:28:49 MH Rel $";
  10. #endif
  11.  
  12.  
  13.  
  14.  
  15. /*man-start*********************************************************************
  16.  
  17.   def_shell_mode()     - Save terminal mode
  18.  
  19.   X/Open Description:
  20.        Save the current terminal modes as the "program" (in CURSES) or
  21.        "shell" (not in CURSES) state for use by the reset_prog_mode()
  22.        and reset_shell_mode() functions.  This is done automatically by
  23.        initscr().
  24.  
  25.   PDCurses Description:
  26.        PDCurses maintains a WINDOW* that contains the original user's
  27.        screen upon startup.  This might be useful for returning the
  28.        user's environment to its (near) original state.
  29.  
  30.        This is unimplemented at this time.
  31.  
  32.   X/Open Return Value:
  33.        The def_shell_mode() function returns OK on success and ERR on error.
  34.  
  35.   X/Open Errors:
  36.        No errors are defined for this function.
  37.  
  38.   Portability:
  39.        PDCurses        int def_shell_mode( void );
  40.        X/Open Dec '88  int def_shell_mode( void );
  41.        BSD Curses
  42.        SYS V Curses    int def_shell_mode( void );
  43.  
  44. **man-end**********************************************************************/
  45.  
  46. int    def_shell_mode(void)
  47. {
  48. #ifdef FLEXOS
  49.        _flexos_8bitmode();
  50. #endif
  51.        c_sh_tty.been_set = TRUE;
  52. #if    defined(DOS) || defined(OS2)
  53. #  if  SMALL || MEDIUM
  54.        movedata( FP_SEG(&_cursvar),            FP_OFF(&_cursvar),
  55.                  FP_SEG(&c_sh_tty.saved),      FP_OFF(&c_sh_tty.saved),
  56.                  sizeof(SCREEN) );
  57. #  else
  58.        memcpy(&c_sh_tty.saved, &_cursvar, sizeof(SCREEN));
  59. #  endif
  60. #endif
  61.        return( OK );
  62. }
  63.